<template>
	<view>
		<view class="news">
			<view class="pic">
				<image :src="item.picurl" mode="aspectFill"></image>
			</view>
			<view class="tex">
				<view class="title">{{item.title}}</view>
				<view class="note" v-if="!item.lookitem">
					<text class="info">作者:{{item.author}}</text>
					<text>浏览:{{item.hits}}</text>
				</view>
				<view class="note" v-else>
					<text>浏览时间：{{item.lookitem}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "newsbox",
		props:{
			item:{
				type:Object,
				default(){
					return{
						title:"你问我为何时常沉默，有的人无话可说，有的话无人可说.你问我为何时常沉默，有的人无话可说，有的话无人可说.",
						author:"龙影",
						hist:622,
						picurl:"../../static/k7q9m7.jpg",
						lookitem:"2022-11-29"
					}
				}
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	.news {
		display: flex;
		flex-direction: row;
		justify-content: space-between;

		.pic {
			height: 160rpx;
			width: 260rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.tex {
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			padding-left: 20rpx;
			.title {
				font-size: 17px;
				display: -webkit-box;
				overflow: hidden;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
			}

			.note {
				color: #646464;
				font-size: 14px;
				.info{
					margin-right: 15rpx;
				}
			}
		}
	}
</style>
